<!DOCTYPE html>
<html>
<head>
    {include file='public/meta'/}
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/cardinfo.css"/>

    <style>
        .checkbox input[type="checkbox"], .checkbox input[type="radio"]{
            width: 18px;
            height: 18px;
            margin-top:1px;
        }
    </style>
</head>
<body id="body">
{include file='public/header'/}
<!------------------导航-------------------------->
<section>
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <!--路径导航-->
        <ol class="breadcrumb mgl15 mgr15">
            <li>当前位置是:</li>
            <li><a href="javascript:history.back();">会员卡管理</a></li>

            <li class="active" style="color: #02b87f;">付费卡</li>
        </ol>
        <!--创建会员卡主要内容-->
        <div class="card-content mgl15 mgr15 clearfix">
            <div>
                <ul class="nav nav-tabs" role="tablist" id="myTabs">
                    <li role="presentation" class="active">
                        <a href="#profile">付费卡设置</a>
                    </li>
                    <li role="presentation">
                        <a href="{:url('cardus/paycarduslist',['card_id'=>$info['card_id']])}" >付费卡购买记录</a>
                    </li>

                </ul>
                <div class="tab-content" style="padding-top: 15px;">
                        <form class="form-horizontal " action="" method="post">
                            <div class="panel panel-default">
                                <div class="panel-heading">付费卡</div>
                                <div class="panel-body">

                                    <div class="form-horizontal ng-scope">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ng-binding">是否开启付费卡</label>
                                            <div class="col-sm-10">
                                                <span class="radio ng-scope radio-inline" >
                                                    <input name="is_pay" type="radio" {eq name="$info['is_pay']" value="1"}checked="checked"{/eq}   value="1">
                                                    <label class="ng-binding">开</label>
                                                </span>
                                                <span class="radio ng-scope radio-inline" >
                                                    <input name="is_pay" type="radio" {eq name="$info['is_pay']" value="0"}checked="checked"{/eq}   value="0">
                                                    <label class="ng-binding">关</label>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="form-group" id="blance" style="display:none;">
                                            <label class="col-sm-2 control-label ng-binding">是否显示到余额</label>
                                            <div class="col-sm-10">
                                                <span class="radio ng-scope radio-inline" >
                                                    <input name="is_pay_balance" type="radio"  {eq name="$info['is_pay_balance']" value="1"}checked="checked"{/eq}  value="1">
                                                    <label class="ng-binding">是</label>
                                                </span>
                                                <span class="radio ng-scope radio-inline" >
                                                    <input name="is_pay_balance" type="radio" {eq name="$info['is_pay_balance']" value="0"}checked="checked"{/eq}   value="0">
                                                    <label class="ng-binding">否</label>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="form-group" id="pay" style="display:none;">
                                            <label class="col-sm-2 control-label ng-binding">金额</label>
                                            <div class="col-sm-7">
                                                <div class="form-inline">
                                                <input type="number" class="form-control requireds"  min="0.01" max="9999" step="0.01" name="price" required id="least_cost" value="{$info['price']}">   元
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group" id="profiles" style="display:none;">
                                            <label class="col-sm-2 control-label ng-binding">简介</label>
                                            <div class="col-sm-5">
                                            <textarea name="pay_profiles" rows="4"  class="form-control" style="resize: none;" required="required" >{$info['pay_profiles']}</textarea>
                                            </div>
                                        </div>



                                        <button class="btn btn-success" type="submit">提交</button>
                                    </div>


                                </div>
                            </div>
                        </form>
                    </div>

        </div>
        </div>
        {include file='public/footer'/}
    </div>
</section>
</body>
<script>

</script>
<script>
$(function(){
    var val=$('input[type=radio][name=is_pay]').val();
    if (val == '1') {
        $("#pay").attr("style","display:block");
        $("#blance").attr("style","display:block");
        $("#profiles").attr("style","display:block");
    }
    else if (val == '0') {
        $("#pay").attr("style","display:none");
        $("#blance").attr("style","display:none");
        $("#profiles").attr("style","display:none");
    }
    $('input[type=radio][name=is_pay]').change(function() {
        if (this.value == '1') {
           $("#pay").attr("style","display:block");
            $("#blance").attr("style","display:block");
            $("#profiles").attr("style","display:block");
        }
        else if (this.value == '0') {
            $("#pay").attr("style","display:none");
            $("#blance").attr("style","display:none");
            $("#profiles").attr("style","display:none");

        }
    });
})
</script>
</html>
